* Graph time series of gun-related news coverage

clear all
set more off

cap mkdir "results"
cap mkdir "results/fig"

use "out-data/gun_news.dta", clear

loc dateticks ""
forvalues y=1990(2)2015 {
    loc tick = mdy(1, 1, `y')
    loc dateticks "`dateticks' `tick'"
}

loc gstyle "grid glwidth(vthin) glcolor(gs14) glpattern(shortdash)"

twoway (line duration date, lcolor(black) lwidth(thin)) /*
    */ , ylabel(0(500)4000, labsize(small) `gstyle') /*
    */   ytitle("Seconds of News Coverage", size(medsmall) height(5)) /*
    */   xline(0, lpattern(solid) lcolor(gs8)) /*
    */   xlabel(`dateticks', labsize(small) format(%tdCY) `gstyle') /*
    */   xtitle("Date", size(medsmall) height(5)) /*
    */   graphregion(color(white)) plotregion(margin(zero)) legend(off)

graph export "results/fig/all_dates.pdf", replace
exit
